home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat5 / acpp.z / acpp
Encoding:
Text File  |  2002-10-03  |  17.5 KB  |  336 lines

  1. ACPP(5)                                                Last changed: 1-5-99
  2.  
  3.  
  4. NNAAMMEE
  5.      aaccpppp - ANSI C language preprocessor
  6.  
  7. IIMMPPLLEEMMEENNTTAATTIIOONN
  8.      IRIX systems
  9.  
  10. DDEESSCCRRIIPPTTIIOONN
  11.      The use of the aaccpppp command is not recommended, because the
  12.      functionality of aaccpppp has been moved into the C front-end and aaccpppp may
  13.      not be supported in future releases.  See mm44(1) for a general macro
  14.      processor.
  15.  
  16.      The aaccpppp preprocessor is a version of GNU ccpppp.  To see which version,
  17.      enter aaccpppp --vv.  The source code to the preprocessor is distributed in
  18.      4Dgifts.
  19.  
  20.      This is intended only as a general statement of the preprocessor's
  21.      capabilities.  For a more precise statement, see the C language
  22.      standard (reference cited at the end of this manual page).
  23.  
  24.      The following options are recognized directly by aaccpppp:
  25.  
  26.      --PP      Preprocess the input without producing the line control
  27.              information used by the next pass of the C compiler.  The
  28.              compiler driver, cccc, defines appropriate symbols.
  29.  
  30.      --DD_n_a_m_e
  31.      --DD_n_a_m_e=_d_e_f
  32.              Define _n_a_m_e with value _d_e_f as if by a ##ddeeffiinnee.  If no =_d_e_f is
  33.              given, _n_a_m_e is defined with value 1.  The --DD option has lower
  34.              precedence than the --UU option.  That is, if the same name is
  35.              used in both a --UU option and a --DD option, the name will be
  36.              undefined regardless of the order of the options.
  37.  
  38.      --II_d_i_r   Change the algorithm for searching for ##iinncclluuddee files whose
  39.              names do not begin with // to look in _d_i_r before looking in the
  40.              directories on the standard list.  Thus, ##iinncclluuddee files whose
  41.              names are enclosed in double quotation marks will be searched
  42.              for first in the directory of the file with the ##iinncclluuddee line
  43.              then in the directories named in --II options, and last in
  44.              directories on a standard list.  For ##iinncclluuddee files whose
  45.              names are enclosed in <<>>, the directory of the file with the
  46.              ##iinncclluuddee line is not searched.  If --II is given with no _d_i_r
  47.              specified, aaccpppp is instructed to suppress the search of the
  48.              standard list of include directories (this form is obsolete,
  49.              use --nnoossttddiinncc instead).  This standard list consists only of
  50.              //uussrr//iinncclluuddee.
  51.  
  52.      --UU_n_a_m_e  Undefines _n_a_m_e, which is only useful if _n_a_m_e is defined via --DD
  53.              or is a predefined name.  The order of the --DD and is not
  54.              significant; the undefines are done after all the --DDs and
  55.              predefines are applied.
  56.  
  57.      --ppeeddaannttiicc
  58.              All ANSI constraints are obeyed when this option is specified.
  59.              Howver, only one ##eellssee or ##eennddiiff with extra tokens after the
  60.              name is reported per included file to reduce the number of
  61.              error reports on older header files.
  62.  
  63.      --ttrraaddiittiioonnaall
  64.              Allows dollar sign ($) in identifiers and makes aaccpppp behave
  65.              like a traditional C preprocessor as defined in _T_h_e _C
  66.              _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l.
  67.  
  68.      --MM      The names of directly included files are printed on standard
  69.              output.
  70.  
  71.      --CC      Comments are retained in the output of aaccpppp.
  72.  
  73.      --nnoossttddiinncc
  74.              The standard places are not searched for include files.  Use
  75.              --II to specify directories to search.
  76.  
  77.              Ordinarily, only options mentioned on the cccc(1) man page are
  78.              of interest.  However aaccpppp has the following options not
  79.              recognized by cccc which can be applied with the cccc flag prefix,
  80.              --WWpp.  For example, to apply the aaccpppp-only option --WWaallll,
  81.              specify cccc --WWpp,,--WWaallll.
  82.  
  83.  
  84.      --pp      All ANSI C constraints are obeyed.  If supplied twice, ##iiddeenntt
  85.              preprocessing directives produce a warning.  Any option
  86.              starting with --pp is considered to mean --ppeeddaannttiicc (see the
  87.              --ppeeddaannttiicc description).
  88.  
  89.      --oo _o_u_t__f_n_a_m_e
  90.              The output is written to _o_u_t__f_n_a_m_e instead of stdout.
  91.  
  92.      --ttrraaddiittiioonnaall
  93.              Allows dollar sign ($) in identifiers and makes aaccpppp behave
  94.              like a traditional C preprocessor as defined in Kernighan &
  95.              Ritchie, First Edition.
  96.  
  97.      --ttrriiggrraapphhss
  98.              Turns on processing of trigraphs.
  99.  
  100.      --BB      Means there is a different, longer, list of default
  101.              directories to search.  And C++   // is understood as a
  102.              introducing a comment.
  103.  
  104.      --++      Means there is a different, longer, list of default
  105.              directories to search.  And C++   // is understood as a
  106.              introducing a comment.
  107.  
  108.      --WWttrriiggrraapphhss
  109.              Warns if any trigraphs are encountered in the text.
  110.  
  111.      --WWccoommmmeennttss
  112.              Warns if a comment start is found within a comment.
  113.  
  114.      --WWccoommmmeenntt
  115.              Warns if a comment start is found within a comment.
  116.  
  117.      --WWaallll   This is the same as having both --WWttrriiggrraapphhss and --WWccoommmmeennttss.
  118.  
  119.      --MM      The names of directly included files are printed on standard
  120.              output.
  121.  
  122.      --MMMM     The names of included files at all nesting levels are printed
  123.              on standard output.
  124.  
  125.      --dd      Instead of writing the preprocessed file out, writes the names
  126.              and values of all preprocessor macros defined.
  127.  
  128.      --vv      Prints the GNU CPP version number.
  129.  
  130.      --CC      Comments are retained in the output of aaccpppp.
  131.  
  132.      --$$      Dollar signs are allowed in identifiers.
  133.  
  134.      --nnoosspplliiccee
  135.              Turn backslash newline into newline when outputting defines,
  136.              but does not consider them to end the macro definition.
  137.  
  138.      --nnoossttddiinncc
  139.              The standard places are not searched for include files.  Use
  140.              --II to specify directories to search.
  141.  
  142.      --uu      Inhibits predefinition of values.  If not supplied, the names
  143.              mmiippss and uunniixx are predefined.  cccc --aannssii passes --uu to aaccpppp.
  144.  
  145.      --ww      Turns off warning messages.
  146.  
  147.      --sshhoowwddeeffiinneess
  148.              Show each ##ddeeffiinnee (##uunnddeeff) followed by the line number and
  149.              file name where it is appears.  The first few defines shown
  150.              are the predefines builtin to ccpppp and passed on the command
  151.              line (for these the line number and file name are
  152.              meaningless).  This facility is to assist you in the special
  153.              situation where you have a ##ddeeffiinnee (##uunnddeeff) and you are having
  154.              difficulty determining which source file it is in.  Use any
  155.              standard text tool to inspect the result file.
  156.  
  157.              Example:
  158.  
  159.           cc  -ansi -E -Imyincludedir -Wp,-showdefines myfile.c >myresult
  160.  
  161.  
  162.      --       As a file name, -- is treated as a file name (stdin or stdout).
  163.  
  164.      Some special names are understood by aaccpppp.  The name ____LLIINNEE____ is
  165.      defined as the current line number (as a decimal integer) as known by
  166.      aaccpppp, and ____FFIILLEE____ is defined as the current file name (as a C string)
  167.      as known by aaccpppp.  The name ____DDAATTEE____ is defined as the date of
  168.      translation of the source file (a character string literal of the form
  169.      MMmmmmmm dddd yyyyyyyy, where the names of the months are the same as those
  170.      generated by the aassccttiimmee(3) function, and the first character of dddd is
  171.      a space character if the value is less than 10).  The name ____TTIIMMEE____ is
  172.      defined as the time of translation of the source file (a character
  173.      string literal of the form hhhh::mmmm::ssss as in the time generated by the
  174.      aassccttiimmee(3) function).  They can be used anywhere (including in macros)
  175.      just as any other defined name.
  176.  
  177.      To distinguish itself from ccpppp(1), aaccpppp defines the macro
  178.      ____AANNSSII__CCPPPP____, setting its value to one.
  179.  
  180.      All aaccpppp directive lines start with any number of blanks and tabs
  181.      followed by ##.  Any number of blanks and tabs are allowed between the
  182.      ## and the directive.  The directives are:
  183.  
  184.  
  185.      ##ddeeffiinnee _n_a_m_e _t_o_k_e_n-_s_t_r_i_n_g
  186.           Replace subsequent instances of _n_a_m_e with _t_o_k_e_n-_s_t_r_i_n_g.
  187.  
  188.      ##ddeeffiinnee _n_a_m_e( _a_r_g, ..., _a_r_g )_t_o_k_e_n-_s_t_r_i_n_g
  189.           Notice that there can be no space between _n_a_m_e and the (.
  190.           Replace subsequent instances of _n_a_m_e followed by a (, a list of
  191.           comma-separated sets of tokens, and a ) followed by _t_o_k_e_n-_s_t_r_i_n_g,
  192.           where each occurrence of an _a_r_g in the _t_o_k_e_n-_s_t_r_i_n_g is replaced
  193.           by the corresponding set of tokens in the comma-separated list.
  194.           When a macro with arguments is expanded, the arguments are placed
  195.           into the expanded _t_o_k_e_n-_s_t_r_i_n_g unchanged.  After the entire
  196.           _t_o_k_e_n-_s_t_r_i_n_g has been expanded, aaccpppp restarts its scan for names
  197.           to expand at the beginning of the newly created _t_o_k_e_n-_s_t_r_i_n_g.
  198.           The ## preprocessing token turns the immediately following
  199.           argument in _t_o_k_e_n-_s_t_r_i_n_g into a string literal (i.e., enclosed in
  200.           double quotation marks) which contains the spelling of the
  201.           argument (see the following example).  The #### preprocessing token
  202.           causes the preceeding preprocessing token to be concatenated with
  203.           the following preprocessing token into a single preprocessing
  204.           token available for further replacement.  Either or both of the
  205.           preprocessing tokens may be substituted macro arguments.  As an
  206.           example of the ## and #### operators, the following sequence:
  207.  
  208.           #define quote(arg)  # arg
  209.           #define glue_to_b(a)     a ## b
  210.           quote(foo)
  211.           glue_to_b(b_follows_me)
  212.  
  213.      creates the following output:
  214.  
  215.                "foo"
  216.           b_follows_meb
  217.  
  218.  
  219.      ##uunnddeeff _n_a_m_e
  220.           Causes the definition of _n_a_m_e (if any) to be forgotten from now
  221.           on.  No additional tokens are permitted on the directive line
  222.           after _n_a_m_e.
  223.  
  224.      ##iiddeenntt "_s_t_r_i_n_g"
  225.           The _s_t_r_i_n_g and the directive are silently ignored.  No output is
  226.           produced for this directive.
  227.  
  228.      ##pprraaggmmaa
  229.           The directive and whatever follows it on the line is passed to
  230.           the output in a slightly modified form which is not documented.
  231.           The form may change in a future release.
  232.  
  233.      ##pprraaggmmaa oonnccee
  234.           If this directive appears in an included file, the file will
  235.           never be included again, even if there is another ##iinncclluuddee of
  236.           this file.  No tokens or comments are permitted after the oonnccee
  237.           keyword.  Using ##pprraaggmmaa oonnccee is more efficient than using macro
  238.           wrappers, because the included file is not rescanned, but it may
  239.           not be portable to third-party preprocessors.
  240.  
  241.      ##iinncclluuddee "_f_i_l_e_n_a_m_e"
  242.      ##iinncclluuddee <_f_i_l_e_n_a_m_e>
  243.           At this point, include the contents of _f_i_l_e_n_a_m_e (which will then
  244.           be run through aaccpppp).  When the <_f_i_l_e_n_a_m_e> notation is used,
  245.           _f_i_l_e_n_a_m_e is only searched for in the standard places.  See the --II
  246.           option above for more detail.  No additional tokens are permitted
  247.           on the directive line after the final quotation mark or >.
  248.  
  249.      ##lliinnee _i_n_t_e_g_e_r-_c_o_n_s_t_a_n_t "_f_i_l_e_n_a_m_e"
  250.           Causes aaccpppp to generate line control information for the next
  251.           pass of the C compiler.  _i_n_t_e_g_e_r-_c_o_n_s_t_a_n_t is the line number of
  252.           the next line and _f_i_l_e_n_a_m_e is the file from which it comes.  If
  253.           "_f_i_l_e_n_a_m_e" is not specified, the current file name is unchanged.
  254.           No additional tokens are permitted on the directive line after
  255.           the optional _f_i_l_e_n_a_m_e.
  256.  
  257.      ##eennddiiff
  258.           Ends a section of lines begun by a test directive (##iiff,, ##iiffddeeff,
  259.           or ##iiffnnddeeff).  Each test directive must have a matching ##eennddiiff.
  260.           No additional tokens are permitted on the directive line.  To
  261.           reduce the volume of error reports on older header files, aaccpppp
  262.           reports only one instance of additional tokens per included file.
  263.  
  264.      ##iiffddeeff _n_a_m_e
  265.           The lines following this option will appear in the output if _n_a_m_e
  266.           has been the subject of a previous ##ddeeffiinnee without being the
  267.           subject of an intervening ##uunnddeeff.  No additional tokens are
  268.           permitted on the directive line after _n_a_m_e.
  269.  
  270.      ##iiffnnddeeff _n_a_m_e
  271.           The lines following this option will appear in the output if _n_a_m_e
  272.           has not been the subject of a previous ##ddeeffiinnee.  No additional
  273.           tokens are permitted on the directive line after _n_a_m_e.
  274.  
  275.      ##iiff _c_o_n_s_t_a_n_t-_e_x_p_r_e_s_s_i_o_n
  276.           Lines following this option will appear in the output if the
  277.           _c_o_n_s_t_a_n_t-_e_x_p_r_e_s_s_i_o_n evaluates to non-zero.  All binary non-
  278.           assignment C operators, the ?: operator, the unary -, !, and ~
  279.           operators are all legal in _c_o_n_s_t_a_n_t-_e_x_p_r_e_s_s_i_o_n.  The precedence
  280.           of the operators is the same as defined by the C language.  There
  281.           is also a unary operator ddeeffiinneedd, which can be used in _c_o_n_s_t_a_n_t-
  282.           _e_x_p_r_e_s_s_i_o_n in these two forms: ddeeffiinneedd ( _n_a_m_e ) or ddeeffiinneedd _n_a_m_e.
  283.           This allows the utility of ##iiffddeeff and ##iiffnnddeeff in a ##iiff directive.
  284.           Only these operators, integer constants, and names which are
  285.           known by aaccpppp should be used in _c_o_n_s_t_a_n_t-_e_x_p_r_e_s_s_i_o_n.  The ssiizzeeooff
  286.           operator is not available.
  287.  
  288.           For example, to test whether either of two symbols, _f_o_o and _f_u_m,
  289.           are defined, specify the following:
  290.  
  291.           #if defined(foo) || defined(fum)
  292.  
  293.      ##eelliiff _c_o_n_s_t_a_n_t-_e_x_p_r_e_s_s_i_o_n
  294.           This is equivalent to specifying ##eellssee with a ##iiff expression, and
  295.           is often more convenient than a nested ##eellssee ##iiff ccoonnssttaanntt--
  296.           eexxpprreessssiioonn  ##eennddiiff ##eennddiiff.
  297.  
  298.      ##eellssee
  299.           The lines following this option will appear in the output if
  300.           preceding test directive evaluates to zero.  No additional tokens
  301.           are permitted on the directive line.  To reduce the volume of
  302.           error reports on older header files, aaccpppp reports only one
  303.           instance of additional tokens per included file.
  304.  
  305.           The test directives and the possible ##eellssee directives can be
  306.           nested.
  307.  
  308.      ##eerrrroorr _p_r_e_p_r_o_c_e_s_s_i_n_g-_t_o_k_e_n_s
  309.           The preprocessing tokens are emitted and an error is signaled to
  310.           cccc.
  311.  
  312.      ##iiddeenntt
  313.           This System V directive is silently accepted and ignored unless
  314.           --ppeeddaannttiicc is supplied twice, in which case a warning is issued
  315.           for each ##iiddeenntt encountered.
  316.  
  317.      ##ssccccss
  318.           This is a BSD-only directive. Use of it creates an error.
  319.  
  320. FFIILLEESS
  321.      //uussrr//iinncclluuddee      Standard directory list for ##iinncclluuddee files
  322.  
  323. NNOOTTEESS
  324.      Two often-used capabilities of the older C preprocessor ccpppp(1) have a
  325.      different syntax in aaccpppp(5).  These are enclosing a macro argument in
  326.      double-quotes, and concatenating tokens.  See the discussion of
  327.      ##ddeeffiinnee for the new syntax.
  328.  
  329. SSEEEE AALLSSOO
  330.      cccc(1), ccpppp(1), lliinnee(1), mm44(1)
  331.  
  332.      AAmmeerriiccaann NNaattiioonnaall CCSSttaannddaarrdd ffoorr IInnffoorrmmaattiioonn SSyysstteemmss -- PPrrooggrraammmmiinngg
  333.      LLaanngguuaaggee - C, ANSI X3.159-1989
  334.  
  335.      This man page is available only online.
  336.